Don't call GetVolumeInformation() for network drives. They might be
authorTor Lillqvist <tml@novell.com>
Sun, 23 Jan 2005 00:06:24 +0000 (00:06 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 23 Jan 2005 00:06:24 +0000 (00:06 +0000)
2005-01-23  Tor Lillqvist  <tml@novell.com>

* gtk/gtkfilesystemwin32.c (gtk_file_system_win32_volume_get_display_name):
Don't call GetVolumeInformation() for network drives. They might
be disconnected, and calling GetVolumeInformation() will then
cause long delays. (#164448) It seems to be very hard to reliably
find out whether a network drive is connected or not, so it's
easier to just not try getting the volume name for them. See the
bug report for discussion.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkfilesystemwin32.c

index 077aecc3bd5060c629ecbdfa1be960dfbe1512e0..c5f5c8c71e0a28a564c91cb3cc7d75739bf2a970 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-01-23  Tor Lillqvist  <tml@novell.com>
+
+       * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_volume_get_display_name): 
+       Don't call GetVolumeInformation() for network drives. They might
+       be disconnected, and calling GetVolumeInformation() will then
+       cause long delays. (#164448) It seems to be very hard to reliably
+       find out whether a network drive is connected or not, so it's
+       easier to just not try getting the volume name for them. See the
+       bug report for discussion.
+
 2005-01-21  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_get_accessible): More details
index 077aecc3bd5060c629ecbdfa1be960dfbe1512e0..c5f5c8c71e0a28a564c91cb3cc7d75739bf2a970 100644 (file)
@@ -1,3 +1,13 @@
+2005-01-23  Tor Lillqvist  <tml@novell.com>
+
+       * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_volume_get_display_name): 
+       Don't call GetVolumeInformation() for network drives. They might
+       be disconnected, and calling GetVolumeInformation() will then
+       cause long delays. (#164448) It seems to be very hard to reliably
+       find out whether a network drive is connected or not, so it's
+       easier to just not try getting the volume name for them. See the
+       bug report for discussion.
+
 2005-01-21  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_get_accessible): More details
index 077aecc3bd5060c629ecbdfa1be960dfbe1512e0..c5f5c8c71e0a28a564c91cb3cc7d75739bf2a970 100644 (file)
@@ -1,3 +1,13 @@
+2005-01-23  Tor Lillqvist  <tml@novell.com>
+
+       * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_volume_get_display_name): 
+       Don't call GetVolumeInformation() for network drives. They might
+       be disconnected, and calling GetVolumeInformation() will then
+       cause long delays. (#164448) It seems to be very hard to reliably
+       find out whether a network drive is connected or not, so it's
+       easier to just not try getting the volume name for them. See the
+       bug report for discussion.
+
 2005-01-21  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwidget.c (gtk_widget_get_accessible): More details
index ff366aa0de64e4c5e94b3379d9f4ccc0fbe0f256..4555299d91fa1b913221fe4fb901cfc92260b6ef 100644 (file)
@@ -606,7 +606,10 @@ gtk_file_system_win32_volume_get_display_name (GtkFileSystem       *file_system,
 
   g_return_val_if_fail (volume->drive != NULL, NULL);
 
-  if ((filename_is_drive_root (volume->drive) && volume->drive[0] >= 'C') ||
+  if (filename_is_drive_root (volume->drive) &&
+      volume->drive_type == DRIVE_REMOTE)
+    real_display_name = g_strdup (volume->drive);
+  else if ((filename_is_drive_root (volume->drive) && volume->drive[0] >= 'C') ||
       volume->drive_type != DRIVE_REMOVABLE)
     {
       gunichar2 *wdrive = g_utf8_to_utf16 (volume->drive, -1, NULL, NULL, NULL);